package com.zx.framework.ws.cxf;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

import org.apache.log4j.Logger;
import org.springframework.core.annotation.Order;
import org.springframework.web.WebApplicationInitializer;
@Order(3)
public class CXFApplicationInitializer implements WebApplicationInitializer{

	private static final Logger LOGGER = Logger
			.getLogger(CXFApplicationInitializer.class);
	@Override
	public void onStartup(ServletContext servletContext)
			throws ServletException {
		if(LOGGER.isDebugEnabled()){
			LOGGER.debug("cxf init!");
		}
		ServletRegistration.Dynamic cxfDynamic = servletContext.addServlet(
				"CXFService", "org.apache.cxf.transport.servlet.CXFServlet");
		cxfDynamic.addMapping("/services/*");
		cxfDynamic.setLoadOnStartup(1);
	}
}
